package cn.tp.ksoft.civil_driver.dialog;

import android.content.Context;
import android.util.SparseArray;
import android.view.View;

import cn.tp.ksoft.civil_driver.R;

/**
 * Created by zhusong on 16/5/11.
 */
public class CarColorDialog extends WheelDialog {
    public CarColorDialog(Context context) {
        super(context);
    }

    @Override
    protected void initData() {
        mTitleTv.setText(getContext().getString(R.string.driver_car_color));
        mWheel1.setVisibility(View.VISIBLE);
        mWheel2.setVisibility(View.GONE);
        mWheel3.setVisibility(View.GONE);
        String[] color = {"红色", "黄色", "香槟色", "银色", "黑色", "白色", "绿色"};
        SparseArray<String> colors = new SparseArray<>(color.length);
        for (int i = 0, len = color.length; i < len; i++) {
            colors.append(i, color[i]);
        }
        mWheelAdapter1.setData(colors);
    }

    @Override
    protected void onPositiveClick() {
        if (null != mCallBack) {
            mCallBack.onPositiveClick(mWheelAdapter1.getValue(mWheel1.getCurrentItem()));
        }
    }
}
